package com.docker.sys.permission;

import com.docker.core.constant.APPIDConstant;
import com.docker.core.mvc.APPID;
import com.docker.core.mvc.Remark;
import com.docker.core.mvc.controller.BaseAPIController;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Okv;

/**
 * @Author ldl
 * @Create 2020/09/18 018 15:15
 */
@Remark("系统权限管理")
@APPID(APPIDConstant.dum_web)
public class PermissionController extends BaseAPIController {

    @Inject
    private PermissionService permissionService;

    /**
     * @Param: []
     * @return: TODO
     * @Author: ldl
     * @Create: 2020/09/18 018 15:23
     */
    @Remark("权限分页列表")
    public void paginate() {
        Okv cond = Okv.create()
                .set("p.perm_name = ", getPara("perm_name"))
                .set("p.controller_name = ", getPara("controller_name"));
        renderAPISuccess(permissionService.paginate(Okv.by("cond", cond), getPageNum(), getPageSize()));
    }

    /**
     * @Param: []
     * @return: TODO
     * @Author: ldl
     * @Create: 2020/09/18 018 15:25
     */
    @Remark("整理系统权限")
    public void tidy() {
        renderAPI(permissionService.tidy());
    }

}
